﻿function ShowMsg(msg)
{
    alert(msg);
}

function ShowMsgAndRedirect(msg, url)
{
    alert(msg);
    window.location.href = url;
}

// lookup windows
function PopupCenter(pageURL, title,w,h) 
{ 
    var left = (screen.width/2)-(w/2); 
    var top = (screen.height/2)-(h/2); 
    var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top='+ top + ', left=' + left);  
}

function ShowLeadContacts()  
{
    var contactId = document.getElementById("ctl00_ContentPlaceHolder1_txtContactID").value;
    //window.open('LeadContacts.aspx?contactId=' + contactId,'_blank','scrollbars=1, width=800px,height=400px');  
    PopupCenter("LeadContacts.aspx?contactId=" + contactId, "Lead Contact", "800px", "600px");
}

function ShowSearchAddress()  
{  
    var addressId = document.getElementById("ctl00_ContentPlaceHolder1_txtAddressID").value;
    //window.open('SearchAddress.aspx?addressId=' + addressId,'_blank','scrollbars=1, width=800px,height=400px');  
    PopupCenter("SearchAddress.aspx?addressId=" + addressId, "Lead Contact", "800px", "600px");
}

function ShowSearchBussinessType()  
{  
    var refId = document.getElementById("ctl00_ContentPlaceHolder1_txtBussinessID").value;
    //window.open('SearchBussinessType.aspx?refId=' + refId,'_blank','scrollbars=1, width=800px,height=400px');  
    PopupCenter("SearchBussinessType.aspx?refId=" + refId, "Lead Contact", "800px", "600px");
}